/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.smarttmt.smartmanager.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author nicolas
 */
@Embeddable
public class ObjeprodPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "OBPRPROD")
    private String obprprod;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "OBPROBJE")
    private String obprobje;

    public ObjeprodPK() {
    }

    public ObjeprodPK(String obprprod, String obprobje) {
        this.obprprod = obprprod;
        this.obprobje = obprobje;
    }

    public String getObprprod() {
        return obprprod;
    }

    public void setObprprod(String obprprod) {
        this.obprprod = obprprod;
    }

    public String getObprobje() {
        return obprobje;
    }

    public void setObprobje(String obprobje) {
        this.obprobje = obprobje;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (obprprod != null ? obprprod.hashCode() : 0);
        hash += (obprobje != null ? obprobje.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ObjeprodPK)) {
            return false;
        }
        ObjeprodPK other = (ObjeprodPK) object;
        if ((this.obprprod == null && other.obprprod != null) || (this.obprprod != null && !this.obprprod.equals(other.obprprod))) {
            return false;
        }
        if ((this.obprobje == null && other.obprobje != null) || (this.obprobje != null && !this.obprobje.equals(other.obprobje))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.smarttmt.smartmanager.entity.ObjeprodPK[ obprprod=" + obprprod + ", obprobje=" + obprobje + " ]";
    }
    
}
